/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-09-08
 * Time: 9:51
 */
class Counter3 {
    public int count;
    public void increase() {
        //对类的实例对象进行加锁
        synchronized (this) {
            count++;
        }
    }
}

class Counter4 {
    public static int count;
    synchronized public static void increase() {
        count++;
    }
}

class Counter5 {
    public static int count;
    public static void increase() {
        //对类对象进行加锁
        synchronized (Counter5.class) {
            count++;
        }
    }
}
public class Demo3 {
}
